# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=bitdump
pkgver=34.6a5cbd8
pkgrel=6
groups=('blackarch' 'blackarch-exploitation' 'blackarch-webapp')
pkgdesc='A tool to extract database data from a blind SQL injection vulnerability.'
arch=('any')
url='https://github.com/nbshelton/bitdump'
license=('GPL2')
depends=('python')
makedepends=('git')
source=("git+https://github.com/nbshelton/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"

  install -Dm 644 -t "$pkgdir/usr/share/$pkgname/" *.py
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python $pkgname.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

